﻿<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Expires" content="0">
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-control" content="no-cache">
		<meta http-equiv="Cache" content="no-cache">
		<meta charset="utf-8">
		
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		
		<title>LDI防呆扫描</title>
	
		<link rel="stylesheet" href="./layui/css/layui.css"/>
		
	</head>
	<body>
		<fieldset class="layui-elem-field site-demo-button">
			<legend><big><b>LDI防呆扫描</b></big></legend>
			<div class="layui-fluid layui-form layui-form-pane">
				<div class="layui-col-sm4">
					<label class="layui-form-label">二维码:</label>
					<div class="layui-input-block">
						<input class="layui-input" placeholder="" id="qrcode" type="text"/>
					</div>
					<label class="layui-form-label">一维码:</label>
					<div class="layui-input-block">
						<input class="layui-input" placeholder="" id="code" type="text"/>
					</div>
					<label class="layui-form-label">匹配结果:</label>
					<div class="layui-input-block">
						<input class="layui-input" placeholder="" id="result" type="text"/>
					</div>
				</div>
			</div>
			
			
		</fieldset>
		<div class="container">
				<div align="right" class="layui-form-item">
					程序版本号：v-1.0.1
				</div>
			
		</div>
		<!-- 加载类ui文件 -->
		<link rel="stylesheet" type="text/css" href="./jexcel-master/dist/css/jquery.jexcel.css" />
		<script src="./_vendor/jquery/dist/jquery.min.js"></script>
		<script src="./jexcel-master/dist/js/jquery.jexcel.js"></script>
		<script src="./_vendor/popper.js/dist/umd/popper.min.js"></script>
		<script src="./_vendor/bootstrap/dist/js/bootstrap.min.js"></script>
		<script src="./_assets/js/custom.js"></script>
		<script src="./layui/layui.js"></script>
		<!-- 写脚本 -->
		<script>
		/**
			//这里是画面准备完毕后执行调用layui格式
		*/
			$(document).ready(function(){
				layui.use(['layer','form','element','table'], function(){
					var layer = layui.layer
						,form = layui.form
						,element = layui.element
						,table = layui.table
					;
					layer.msg('初始化正常!');
				});
			});
			var qrcode="";
			var code="";
			
			$("#qrcode").keypress(function(e){
				var key = e.which;
				if (key == 13) {
					qrcode=$("#qrcode").val();
					$("#code").select().val('');
					$("#result").val('');
					
				}
			});
			$("#code").keypress(function(e){
				var key = e.which;
				
				if (key == 13) {
					code=$("#code").val();
					
					if(qrcode.indexOf(code)!= -1 &&code.length==13){
						$("#result").val('匹配成功').css('color','green');
						$("#qrcode").select().val('');
					}
					else{
						$("#result").val('匹配失败').css('color','red');
					}
					
					
				}
			});
		
		
		
		</script>
	</body>
</html>